<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">
<ui:composition template="/layouts/default.xhtml">
    <ui:define name="title">#{text['activeUsers.title']}</ui:define>
    <ui:param name="menu" value="AdminMenu"/>

    <ui:define name="body">
        <div class="col-sm-10">
            <h2>#{text['activeUsers.heading']}</h2>

            <p>#{text['activeUsers.message']}</p>

            <div id="actions" class="form-group">
                <input type="button" class="btn btn-default" onclick="location.href='../home'" value="#{text['button.done']}"/>
            </div>

            <h:form id="activeUsersForm">

                <p:dataTable id="activeUsers" var="user" value="#{activeUserList.users}"
                             sortBy="#{activeUserList.sortColumn}" paginator="true" rows="25"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="5,10,15">
                    <p:column style="width: 25%">
                        <f:facet name="header">
                            <p:column sortBy="username">
                                <h:outputText value="#{text['user.username']}"/>
                            </p:column>
                        </f:facet>
                        <h:outputText value="#{user.username}"/>
                    </p:column>
                    <p:column style="width: 34%">
                        <f:facet name="header">
                            <p:column sortBy="fullName">
                                <h:outputText value="#{text['activeUsers.fullName']}"/>
                            </p:column>
                        </f:facet>
                        <h:outputText value="#{user.fullName}"/>
                        <h:outputLink value="mailto:#{user.email}" rendered="#{not empty user.email}">
                            <h:graphicImage style="padding-lefp: 10px;" alt="#{text['icon.email']}"
                                            url="/images/iconEmail.gif"/>
                        </h:outputLink>
                    </p:column>
                </p:dataTable>

            </h:form>
        </div>
    </ui:define>
</ui:composition>
</html>   
